﻿using System;

namespace XTengine.ComponentModel
{
    public class DoubleConverter : TypeConverter<Double>
    {
        public override Double ConvertFrom(string value)
        {
            Double result;
            if (Double.TryParse(value, out result))
            {
                return result;
            }

            return 0;
        }

        public override string ConvertTo(Double value)
        {
            return value.ToString();
        }
    }
}